<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="com.nce.util.LoginUserUtil"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>站內搜索</title>
		<link href="${ctx}/css/jehoo.css" rel="stylesheet" type="text/css" />
		<link href="${ctx}/css/colorbox.css" rel="stylesheet" type="text/css" />
		<script src="${ctx}/js/jquery.js" type="text/javascript"></script>
		<script src="${ctx}/js/jquery.colorbox.js" type="text/javascript"></script>
		<script src="${ctx}/js/table.js" type="text/javascript"></script>
		<script>
$(document)
		.ready(function() {
			//Examples of how to assign the ColorBox event to elements			
				$("#addKeys").colorbox( {
					iframe : true,
					width : "95%",
					height : "90%",
					opacity : 0.75,
					close : "关闭"
				});
				$("#addMblogvip").colorbox( {
					iframe : true,
					width : "95%",
					height : "90%",
					opacity : 0.75,
					close : "关闭"
				});
				$("#tips_txt").hide();
				$("#tips").hover(function(e) {
					if ($("#tips_txt").css("display") == "none") {
						$("#tips_txt").show();
					} else {
						$("#tips_txt").hide();
					}

				});

				$("#report_btn").click(
						function() {
							$("#search_form").attr("target", "blank");
							$("#search_form").attr("action",
									"/s/search!exportNews.action");
							$("#search_form").submit();
							return false;
						});

				$("a[href='${ctx}/s/search!getBaseNews.action']").attr("class",
						"selected");
				$("#search_form").attr("action",
						"${ctx}/s/search!getBaseNews.action");
					var url = encodeURI("${ctx}/s/goexport.action?content=basenews&words=${words}&type=<c:if test='${isTitle}'>title</c:if><c:if test='${!isTitle}'>content</c:if>");
				$(".report_indicator a").colorbox({
				href:url,
				iframe:true, 
				width:"95%", 
				height:"90%",
				opacity : 0.75
				});	
			});
</script>
	</head>
	<body>
		<div id="body" align="center">
			<div id="main" align="center">
				<div id="middle_top">
					<%@ include file="/common/menu.jsp"%>
				</div>
				<div id="middle_bottom">
					<s:if test="baseNewsPage.result==null || baseNewsPage.result.isEmpty()">
						<div class="success">
							暂无相关结果，请调整您的关键词设置。
						</div>
					</s:if>
					<s:else>
						<form id="mainForm" action="${ctx}/s/search!getBaseNews.action"
							method="post">
							<div id="keyword_pagebar">
								<span class="page_indicator report_indicator"><a
									id="report_btn" target="_blank"
									href="${ctx}/s/search!exportNews.action">日报导出</a> </span>
								<span class="page_indicator"><a
									href="javascript:jumpPage(${baseNewsPage.totalPages})">末页</a> </span>
								<s:if test="baseNewsPage.hasNext">
									<span class="page_indicator"><a
										href="javascript:jumpPage(${baseNewsPage.nextPage})">下一页</a> </span>
								</s:if>
								<span id="page_number">${baseNewsPage.pageNo}</span>
								<s:if test="baseNewsPage.hasPre">
									<span class="page_indicator"><a
										href="javascript:jumpPage(${baseNewsPage.prePage})">上一页</a> </span>
								</s:if>
								<span class="page_indicator"><a
									href="javascript:jumpPage(1)">首页</a> </span>
								<span class="page_indicator">${baseNewsPage.pageNo}/${baseNewsPage.totalPages}</span>
							</div>
							<input type="hidden" name="baseNewsPage.pageNo" id="pageNo"
								value="${baseNewsPage.pageNo}" />
							<input type="hidden" name="baseNewsPage.orderBy" id="orderBy"
								value="${baseNewsPage.orderBy}" />
							<input type="hidden" name="baseNewsPage.order" id="order"
								value="${baseNewsPage.order}" />
							<input type="hidden" name="words" value="${words}" />
							<c:if test="${!isTitle}">
								<input type="hidden" name="type" value="content"></input>
							</c:if>
							<c:if test="${isTitle}">
								<input type="hidden" name="type" value="title"></input>
							</c:if>

							<s:iterator status="spin" value="baseNewsPage.result">

								<div class="news_frame">
									<div class="news_content" align="left">
										<div class="news_title_frame">
											<c:if test="${isNew=='true'}">
												<span class="news_tag">【新】</span>
											</c:if>

											<span class="news_title"><a href="${url}" target="_blank">${viewTitle}</a> </span>
											<span class="news_res">${forumName}</span>
											<span class="news_date"><s:date name="tmPost" format="yyyy-MM-dd" /></span>
										</div>
										<!-- '...'可以通过取数据时设置 -->
										<span class="news_txt">${viewContent}</span>
									</div>
								</div>
							</s:iterator>
							<div id="keyword_pagebar">
								<span class="page_indicator report_indicator"><a
									id="report_btn" target="_blank"
									href="${ctx}/s/search!exportNews.action">日报导出</a> </span>
								<span class="page_indicator"><a
									href="javascript:jumpPage(${baseNewsPage.totalPages})">末页</a> </span>
								<s:if test="baseNewsPage.hasNext">
									<span class="page_indicator"><a
										href="javascript:jumpPage(${baseNewsPage.nextPage})">下一页</a> </span>
								</s:if>
								<span id="page_number">${baseNewsPage.pageNo}</span>
								<s:if test="baseNewsPage.hasPre">
									<span class="page_indicator"><a
										href="javascript:jumpPage(${baseNewsPage.prePage})">上一页</a> </span>
								</s:if>
								<span class="page_indicator"><a
									href="javascript:jumpPage(1)">首页</a> </span>
								<span class="page_indicator">${baseNewsPage.pageNo}/${baseNewsPage.totalPages}</span>
							</div>
						</form>
					</s:else>
				</div>
			</div>
		</div>
		<div id="bottom">
			<%@ include file="/common/footer.jsp"%>
		</div>
	</body>
</html>